import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
//icons
import Icons from 'unplugin-icons/vite'
import IconsResolver from 'unplugin-icons/resolver'
import { VueAmapResolver } from '@vuemap/unplugin-resolver'

export default function autoImport(plugins) {
  plugins.push(
    AutoImport({
      imports: [
        'vue',
        {
          'naive-ui': ['useDialog', 'useMessage', 'useNotification', 'useLoadingBar'],
        },
      ],
      resolvers: [VueAmapResolver()],
    }),
    Icons({
      compiler: 'vue3',
      autoInstall: true,
      defaultStyle: 'display: inline-block',
    }),
    Components({
      resolvers: [
        NaiveUiResolver(),
        VueAmapResolver(),
        IconsResolver({
          componentPrefix: '',
        }),
      ],
    }),
  )
}
